<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->date('birth_date')->nullable()->comment('出生日期');
            $table->tinyInteger('id_type')->default(0)->comment('证件类型: 1-身份证, 2-护照, 3-军官证等');
            $table->string('ethnicity', 20)->default('/')->comment('民族');
            $table->string('political_status', 20)->default('/')->comment('政治面貌');
            $table->string('education', 20)->default('/')->comment('文化程度');
            $table->string('household_register', 100)->default('/')->comment('户籍所在地');
            $table->string('residential_address', 100)->default('/')->comment('居住地址');
            $table->string('contract_type', 100)->nullable()->comment('合同日期');
            $table->string('contract_start_date', 100)->nullable()->comment('合同日期');
            $table->string('contract_end_date', 100)->nullable()->comment('合同日期');
            $table->string('trial_start_period', 100)->nullable()->comment('试用期');
            $table->string('trial_end_period', 100)->nullable()->comment('试用期');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('birth_date');
            $table->dropColumn('id_type');
            $table->dropColumn('ethnicity');
            $table->dropColumn('political_status');
            $table->dropColumn('education');
            $table->dropColumn('household_register');
            $table->dropColumn('residential_address');
            $table->dropColumn('contract_type');
            $table->dropColumn('contract_start_date');
            $table->dropColumn('contract_end_date');
            $table->dropColumn('trial_start_period');
            $table->dropColumn('trial_end_period');
        });
    }
};
